#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>

int main() {
	char ch[500][500];
	int maxn = -2147483647;
	char c;
	int len, i = 1, ans;
	c = getchar();
	while (1)
	{
		if (c == ' ' || c == '\n')
		{
			if (len > maxn) 
			{
				maxn = len;
				ans = i;
			}
			i++;
			len = 1;
			if (c == '\n')break;
			c = getchar();
		}
		ch[i][len] = c;
		c = getchar();
		len++;
	}
	for (int j = 1; j <= maxn; j++)putchar(ch[ans][j]);
	return 0;
}